﻿<UserControl x:Class="MediaAssistant.Controls.AddMovie.AddMovieView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:Converters="clr-namespace:MediaAssistant.Converters" 
             Width="600" Height="280" Background="{StaticResource BodyBackground}">
    <UserControl.Resources>
        <Converters:NullVisibilityConverter x:Key="NullVisibilityConverter" />
    </UserControl.Resources>
    <DockPanel>
        <Border DockPanel.Dock="Top" BorderThickness="2" BorderBrush="LightGray" Padding="5" Margin="2">
            <TextBlock TextWrapping="Wrap">Add movie which are not available at your repository or local storage. If you want to add a movie file then use Add File or Add Folder menu. Media Assistant will scan your file to get movie details.</TextBlock>
        </Border>
        <Border BorderBrush="LightGray" BorderThickness="2" DockPanel.Dock="Left" Width="160" Padding="2" Margin="2">
            <Grid>
                <ContentControl Content="{StaticResource MoviePosterImage}"
                                    Visibility="{Binding Movie.PosterImage, Converter={StaticResource NullVisibilityConverter}}"/>
                <Image HorizontalAlignment="Center" VerticalAlignment="Center">
                    <Image.Source>
                        <MultiBinding Converter="{StaticResource PosterImageConverter}">
                            <Binding Path="Movie"/>
                            <Binding Path="Movie.Poster"/>
                            <Binding Path="Movie.PosterImage"/>
                        </MultiBinding>
                    </Image.Source>
                </Image>
            </Grid>
        </Border>
        <Grid>
            <StackPanel DockPanel.Dock="Left" Margin="5">
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Title" Margin="0,5,5,5" VerticalAlignment="Center" FontSize="15" FontWeight="Bold"/>
                    <TextBox Text="{Binding Movie.Title}" FontSize="15" FontWeight="Bold" Width="300" Margin="0,5"/>
                    <Button Content="Search IMDb" 
                                FontSize="15" Margin="5,10" Style="{StaticResource LinkButtonStyle}" 
                                Command="{Binding SearchIMDbCommand}"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding Movie.Rated}" Margin="0,5" FontWeight="Bold"/>
                    <TextBlock Text="{Binding Movie.Runtime}" Margin="10,5" Foreground="Gray"/>
                    <TextBlock Text="{Binding Genres}" Margin="0,5,0,5"/>
                    <TextBlock Text="{Binding Movie.Released, StringFormat='- {0:MMMM d, yyyy}'}" Margin="5"/>
                </StackPanel>
                <Border Margin="0,5" BorderThickness="1" BorderBrush="LightGray"/>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding Movie.Rating, StringFormat='Rating: {0}/10'}" FontSize="15" VerticalAlignment="Center"/>
                    <TextBlock Text="{Binding Movie.Votes, StringFormat='Votes: {0}'}" Margin="20,0"  FontSize="15" VerticalAlignment="Center"/>
                </StackPanel>
                <Border Margin="0,5" BorderThickness="1" BorderBrush="LightGray"/>
                <TextBlock Text="{Binding Movie.Plot}" TextWrapping="Wrap"/>
                <StackPanel Orientation="Horizontal" Margin="0,5">
                    <TextBlock Text="Director:" Margin="0,0,5,0"/>
                    <TextBlock Text="{Binding Directors}"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Writers:" Margin="0,0,5,0"/>
                    <TextBlock Text="{Binding Writers}"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal" Margin="0,5">
                    <TextBlock Text="Stars:" Margin="0,0,5,0"/>
                    <TextBlock Text="{Binding Stars}"/>
                </StackPanel>
            </StackPanel>
        </Grid>
    </DockPanel>
</UserControl>
